package com.k2data.test.testng.listener.trans.factory;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.Arrays;

import org.testng.IAnnotationTransformer2;
import org.testng.annotations.IConfigurationAnnotation;
import org.testng.annotations.IDataProviderAnnotation;
import org.testng.annotations.IFactoryAnnotation;
import org.testng.annotations.ITestAnnotation;

/**
 * Annotation transform demo
 * @author wangchuan 2019-03-18
 *
 */
public class FactoryAnnotationTransformListener implements IAnnotationTransformer2 {

	/**
	 * Configuration annotation transform
	 */
	@Override
	public void transform(IConfigurationAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) {
	}
	
	/**
	 * Test annotation transform
	 */
	@Override
	public void transform(ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) {	
	}

	/**
	 * DataProvider annotation transform
	 */
	@Override
	public void transform(IDataProviderAnnotation annotation, Method method) {
	}	

	/**
	 * Factory annotation transform
	 */
	@Override
	public void transform(IFactoryAnnotation annotation, Method method) {
		System.out.println("[IFactoryAnnotation] getIndices: " + annotation.getIndices());
		System.out.println("[IFactoryAnnotation] getClass: " + annotation.getClass());
	}		
}
